package stu.day39_day.day40;

import java.util.Scanner;

public class hw1 {

    public static int  t1(int[] n) {
        int len = n.length;
        int[] dp = new int[len+1];
        dp[1] = n[0];
        for (int i = 1; i < len; i++) {
            dp[i+1] = Math.max(dp[i], dp[i-1] + n[i]);
        }
        return dp[len];
    }




    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String[] str = sc.nextLine().split(" ");
        int[] n = new int[str.length];
        for (int i = 0; i < str.length; i++) {
            n[i] = Integer.parseInt(str[i]);
        }
        System.out.println(t1(n));
    }
}
